<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1998

\section[PatSyn]{@PatSyn@: Pattern synonyms}
-}</span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Core.PatSyn</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-11"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Main data types</span></span><span>
</span><span id="line-12"></span><span>        </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier">PatSyn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#mkPatSyn"><span class="hs-identifier">mkPatSyn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Type deconstruction</span></span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynName"><span class="hs-identifier">patSynName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynArity"><span class="hs-identifier">patSynArity</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynIsInfix"><span class="hs-identifier">patSynIsInfix</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynArgs"><span class="hs-identifier">patSynArgs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynMatcher"><span class="hs-identifier">patSynMatcher</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynBuilder"><span class="hs-identifier">patSynBuilder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynUnivTyVarBinders"><span class="hs-identifier">patSynUnivTyVarBinders</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynExTyVars"><span class="hs-identifier">patSynExTyVars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynExTyVarBinders"><span class="hs-identifier">patSynExTyVarBinders</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynSig"><span class="hs-identifier">patSynSig</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynSigBndr"><span class="hs-identifier">patSynSigBndr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynInstArgTys"><span class="hs-identifier">patSynInstArgTys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynInstResTy"><span class="hs-identifier">patSynInstResTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynFieldLabels"><span class="hs-identifier">patSynFieldLabels</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynFieldType"><span class="hs-identifier">patSynFieldType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Core.PatSyn.html#updatePatSynIds"><span class="hs-identifier">updatePatSynIds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#pprPatSynType"><span class="hs-identifier">pprPatSynType</span></a></span><span>
</span><span id="line-24"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Ppr.html"><span class="hs-identifier">GHC.Core.TyCo.Ppr</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html"><span class="hs-identifier">GHC.Types.Unique</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html"><span class="hs-identifier">GHC.Types.FieldLabel</span></a></span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#"><span class="hs-identifier">Data.Data</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Data</span></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Function.html#"><span class="hs-identifier">Data.Function</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Foldable.html#find"><span class="hs-identifier">find</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Pattern synonyms}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span class="hs-comment">-- | Pattern Synonym</span><span>
</span><span id="line-53"></span><span class="hs-comment">--</span><span>
</span><span id="line-54"></span><span class="hs-comment">-- See Note [Pattern synonym representation]</span><span>
</span><span id="line-55"></span><span class="hs-comment">-- See Note [Pattern synonym signature contexts]</span><span>
</span><span id="line-56"></span><span class="hs-keyword">data</span><span> </span><span id="PatSyn"><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-var">PatSyn</span></a></span></span><span>
</span><span id="line-57"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="MkPatSyn"><span class="annot"><a href="GHC.Core.PatSyn.html#MkPatSyn"><span class="hs-identifier hs-var">MkPatSyn</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-58"></span><span>        </span><span id="psName"><span class="annot"><span class="annottext">PatSyn -&gt; Name
</span><a href="GHC.Core.PatSyn.html#psName"><span class="hs-identifier hs-var hs-var">psName</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-59"></span><span>        </span><span id="psUnique"><span class="annot"><span class="annottext">PatSyn -&gt; Unique
</span><a href="GHC.Core.PatSyn.html#psUnique"><span class="hs-identifier hs-var hs-var">psUnique</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span>       </span><span class="hs-comment">-- Cached from Name</span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span>        </span><span id="psArgs"><span class="annot"><span class="annottext">PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#psArgs"><span class="hs-identifier hs-var hs-var">psArgs</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-62"></span><span>        </span><span id="psArity"><span class="annot"><span class="annottext">PatSyn -&gt; Arity
</span><a href="GHC.Core.PatSyn.html#psArity"><span class="hs-identifier hs-var hs-var">psArity</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span class="hs-special">,</span><span>        </span><span class="hs-comment">-- == length psArgs</span><span>
</span><span id="line-63"></span><span>        </span><span id="psInfix"><span class="annot"><span class="annottext">PatSyn -&gt; Bool
</span><a href="GHC.Core.PatSyn.html#psInfix"><span class="hs-identifier hs-var hs-var">psInfix</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- True &lt;=&gt; declared infix</span><span>
</span><span id="line-64"></span><span>        </span><span id="psFieldLabels"><span class="annot"><span class="annottext">PatSyn -&gt; [FieldLabel]
</span><a href="GHC.Core.PatSyn.html#psFieldLabels"><span class="hs-identifier hs-var hs-var">psFieldLabels</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- List of fields for a</span><span>
</span><span id="line-65"></span><span>                                       </span><span class="hs-comment">-- record pattern synonym</span><span>
</span><span id="line-66"></span><span>                                       </span><span class="hs-comment">-- INVARIANT: either empty if no</span><span>
</span><span id="line-67"></span><span>                                       </span><span class="hs-comment">-- record pat syn or same length as</span><span>
</span><span id="line-68"></span><span>                                       </span><span class="hs-comment">-- psArgs</span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span>        </span><span class="hs-comment">-- Universally-quantified type variables</span><span>
</span><span id="line-71"></span><span>        </span><span id="psUnivTyVars"><span class="annot"><span class="annottext">PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psUnivTyVars"><span class="hs-identifier hs-var hs-var">psUnivTyVars</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InvisTVBinder"><span class="hs-identifier hs-type">InvisTVBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-72"></span><span>
</span><span id="line-73"></span><span>        </span><span class="hs-comment">-- Required dictionaries (may mention psUnivTyVars)</span><span>
</span><span id="line-74"></span><span>        </span><span id="psReqTheta"><span class="annot"><span class="annottext">PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#psReqTheta"><span class="hs-identifier hs-var hs-var">psReqTheta</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier hs-type">ThetaType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span>        </span><span class="hs-comment">-- Existentially-quantified type vars</span><span>
</span><span id="line-77"></span><span>        </span><span id="psExTyVars"><span class="annot"><span class="annottext">PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psExTyVars"><span class="hs-identifier hs-var hs-var">psExTyVars</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InvisTVBinder"><span class="hs-identifier hs-type">InvisTVBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span>        </span><span class="hs-comment">-- Provided dictionaries (may mention psUnivTyVars or psExTyVars)</span><span>
</span><span id="line-80"></span><span>        </span><span id="psProvTheta"><span class="annot"><span class="annottext">PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#psProvTheta"><span class="hs-identifier hs-var hs-var">psProvTheta</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier hs-type">ThetaType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span>        </span><span class="hs-comment">-- Result type</span><span>
</span><span id="line-83"></span><span>        </span><span id="psResultTy"><span class="annot"><span class="annottext">PatSyn -&gt; Type
</span><a href="GHC.Core.PatSyn.html#psResultTy"><span class="hs-identifier hs-var hs-var">psResultTy</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">,</span><span>  </span><span class="hs-comment">-- Mentions only psUnivTyVars</span><span>
</span><span id="line-84"></span><span>                               </span><span class="hs-comment">-- See Note [Pattern synonym result type]</span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span>        </span><span class="hs-comment">-- See Note [Matchers and builders for pattern synonyms]</span><span>
</span><span id="line-87"></span><span>        </span><span id="psMatcher"><span class="annot"><span class="annottext">PatSyn -&gt; (TyVar, Bool)
</span><a href="GHC.Core.PatSyn.html#psMatcher"><span class="hs-identifier hs-var hs-var">psMatcher</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-88"></span><span>             </span><span class="hs-comment">-- Matcher function.</span><span>
</span><span id="line-89"></span><span>             </span><span class="hs-comment">-- If Bool is True then prov_theta and arg_tys are empty</span><span>
</span><span id="line-90"></span><span>             </span><span class="hs-comment">-- and type is</span><span>
</span><span id="line-91"></span><span>             </span><span class="hs-comment">--   forall (p :: RuntimeRep) (r :: TYPE p) univ_tvs.</span><span>
</span><span id="line-92"></span><span>             </span><span class="hs-comment">--                          req_theta</span><span>
</span><span id="line-93"></span><span>             </span><span class="hs-comment">--                       =&gt; res_ty</span><span>
</span><span id="line-94"></span><span>             </span><span class="hs-comment">--                       -&gt; (forall ex_tvs. Void# -&gt; r)</span><span>
</span><span id="line-95"></span><span>             </span><span class="hs-comment">--                       -&gt; (Void# -&gt; r)</span><span>
</span><span id="line-96"></span><span>             </span><span class="hs-comment">--                       -&gt; r</span><span>
</span><span id="line-97"></span><span>             </span><span class="hs-comment">--</span><span>
</span><span id="line-98"></span><span>             </span><span class="hs-comment">-- Otherwise type is</span><span>
</span><span id="line-99"></span><span>             </span><span class="hs-comment">--   forall (p :: RuntimeRep) (r :: TYPE r) univ_tvs.</span><span>
</span><span id="line-100"></span><span>             </span><span class="hs-comment">--                          req_theta</span><span>
</span><span id="line-101"></span><span>             </span><span class="hs-comment">--                       =&gt; res_ty</span><span>
</span><span id="line-102"></span><span>             </span><span class="hs-comment">--                       -&gt; (forall ex_tvs. prov_theta =&gt; arg_tys -&gt; r)</span><span>
</span><span id="line-103"></span><span>             </span><span class="hs-comment">--                       -&gt; (Void# -&gt; r)</span><span>
</span><span id="line-104"></span><span>             </span><span class="hs-comment">--                       -&gt; r</span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span>        </span><span id="psBuilder"><span class="annot"><span class="annottext">PatSyn -&gt; Maybe (TyVar, Bool)
</span><a href="GHC.Core.PatSyn.html#psBuilder"><span class="hs-identifier hs-var hs-var">psBuilder</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span>
</span><span id="line-107"></span><span>             </span><span class="hs-comment">-- Nothing  =&gt; uni-directional pattern synonym</span><span>
</span><span id="line-108"></span><span>             </span><span class="hs-comment">-- Just (builder, is_unlifted) =&gt; bi-directional</span><span>
</span><span id="line-109"></span><span>             </span><span class="hs-comment">-- Builder function, of type</span><span>
</span><span id="line-110"></span><span>             </span><span class="hs-comment">--  forall univ_tvs, ex_tvs. (req_theta, prov_theta)</span><span>
</span><span id="line-111"></span><span>             </span><span class="hs-comment">--                       =&gt;  arg_tys -&gt; res_ty</span><span>
</span><span id="line-112"></span><span>             </span><span class="hs-comment">-- See Note [Builder for pattern synonyms with unboxed type]</span><span>
</span><span id="line-113"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="hs-comment">{- Note [Pattern synonym signature contexts]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In a pattern synonym signature we write
   pattern P :: req =&gt; prov =&gt; t1 -&gt; ... tn -&gt; res_ty

Note that the &quot;required&quot; context comes first, then the &quot;provided&quot;
context.  Moreover, the &quot;required&quot; context must not mention
existentially-bound type variables; that is, ones not mentioned in
res_ty.  See lots of discussion in #10928.

If there is no &quot;provided&quot; context, you can omit it; but you
can't omit the &quot;required&quot; part (unless you omit both).

Example 1:
      pattern P1 :: (Num a, Eq a) =&gt; b -&gt; Maybe (a,b)
      pattern P1 x = Just (3,x)

  We require (Num a, Eq a) to match the 3; there is no provided
  context.

Example 2:
      data T2 where
        MkT2 :: (Num a, Eq a) =&gt; a -&gt; a -&gt; T2

      pattern P2 :: () =&gt; (Num a, Eq a) =&gt; a -&gt; T2
      pattern P2 x = MkT2 3 x

  When we match against P2 we get a Num dictionary provided.
  We can use that to check the match against 3.

Example 3:
      pattern P3 :: Eq a =&gt; a -&gt; b -&gt; T3 b

   This signature is illegal because the (Eq a) is a required
   constraint, but it mentions the existentially-bound variable 'a'.
   You can see it's existential because it doesn't appear in the
   result type (T3 b).

Note [Pattern synonym result type]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
   data T a b = MkT b a

   pattern P :: a -&gt; T [a] Bool
   pattern P x = MkT True [x]

P's psResultTy is (T a Bool), and it really only matches values of
type (T [a] Bool).  For example, this is ill-typed

   f :: T p q -&gt; String
   f (P x) = &quot;urk&quot;

This is different to the situation with GADTs:

   data S a where
     MkS :: Int -&gt; S Bool

Now MkS (and pattern synonyms coming from MkS) can match a
value of type (S a), not just (S Bool); we get type refinement.

That in turn means that if you have a pattern

   P x :: T [ty] Bool

it's not entirely straightforward to work out the instantiation of
P's universal tyvars. You have to /match/
  the type of the pattern, (T [ty] Bool)
against
  the psResultTy for the pattern synonym, T [a] Bool
to get the instantiation a := ty.

This is very unlike DataCons, where univ tyvars match 1-1 the
arguments of the TyCon.

Side note: I (SG) get the impression that instantiated return types should
generate a *required* constraint for pattern synonyms, rather than a *provided*
constraint like it's the case for GADTs. For example, I'd expect these
declarations to have identical semantics:

    pattern Just42 :: Maybe Int
    pattern Just42 = Just 42

    pattern Just'42 :: (a ~ Int) =&gt; Maybe a
    pattern Just'42 = Just 42

The latter generates the proper required constraint, the former does not.
Also rather different to GADTs is the fact that Just42 doesn't have any
universally quantified type variables, whereas Just'42 or MkS above has.

Note [Pattern synonym representation]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider the following pattern synonym declaration

        pattern P x = MkT [x] (Just 42)

where
        data T a where
              MkT :: (Show a, Ord b) =&gt; [b] -&gt; a -&gt; T a

so pattern P has type

        b -&gt; T (Maybe t)

with the following typeclass constraints:

        requires: (Eq t, Num t)
        provides: (Show (Maybe t), Ord b)

In this case, the fields of MkPatSyn will be set as follows:

  psArgs       = [b]
  psArity      = 1
  psInfix      = False

  psUnivTyVars = [t]
  psExTyVars   = [b]
  psProvTheta  = (Show (Maybe t), Ord b)
  psReqTheta   = (Eq t, Num t)
  psResultTy  = T (Maybe t)

Note [Matchers and builders for pattern synonyms]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For each pattern synonym P, we generate

  * a &quot;matcher&quot; function, used to desugar uses of P in patterns,
    which implements pattern matching

  * A &quot;builder&quot; function (for bidirectional pattern synonyms only),
    used to desugar uses of P in expressions, which constructs P-values.

For the above example, the matcher function has type:

        $mP :: forall (r :: ?) t. (Eq t, Num t)
            =&gt; T (Maybe t)
            -&gt; (forall b. (Show (Maybe t), Ord b) =&gt; b -&gt; r)
            -&gt; (Void# -&gt; r)
            -&gt; r

with the following implementation:

        $mP @r @t $dEq $dNum scrut cont fail
          = case scrut of
              MkT @b $dShow $dOrd [x] (Just 42) -&gt; cont @b $dShow $dOrd x
              _                                 -&gt; fail Void#

Notice that the return type 'r' has an open kind, so that it can
be instantiated by an unboxed type; for example where we see
     f (P x) = 3#

The extra Void# argument for the failure continuation is needed so that
it is lazy even when the result type is unboxed.

For the same reason, if the pattern has no arguments, an extra Void#
argument is added to the success continuation as well.

For *bidirectional* pattern synonyms, we also generate a &quot;builder&quot;
function which implements the pattern synonym in an expression
context. For our running example, it will be:

        $bP :: forall t b. (Eq t, Num t, Show (Maybe t), Ord b)
            =&gt; b -&gt; T (Maybe t)
        $bP x = MkT [x] (Just 42)

NB: the existential/universal and required/provided split does not
apply to the builder since you are only putting stuff in, not getting
stuff out.

Injectivity of bidirectional pattern synonyms is checked in
tcPatToExpr which walks the pattern and returns its corresponding
expression when available.

Note [Builder for pattern synonyms with unboxed type]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For bidirectional pattern synonyms that have no arguments and have an
unboxed type, we add an extra Void# argument to the builder, else it
would be a top-level declaration with an unboxed type.

        pattern P = 0#

        $bP :: Void# -&gt; Int#
        $bP _ = 0#

This means that when typechecking an occurrence of P in an expression,
we must remember that the builder has this void argument. This is
done by GHC.Tc.TyCl.PatSyn.patSynBuilderOcc.

Note [Pattern synonyms and the data type Type]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The type of a pattern synonym is of the form (See Note
[Pattern synonym signatures] in GHC.Tc.Gen.Sig):

    forall univ_tvs. req =&gt; forall ex_tvs. prov =&gt; ...

We cannot in general represent this by a value of type Type:

 - if ex_tvs is empty, then req and prov cannot be distinguished from
   each other
 - if req is empty, then univ_tvs and ex_tvs cannot be distinguished
   from each other, and moreover, prov is seen as the &quot;required&quot; context
   (as it is the only context)


************************************************************************
*                                                                      *
\subsection{Instances}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-325"></span><span>    </span><span id="local-6989586621680848426"><span class="annot"><span class="annottext">== :: PatSyn -&gt; PatSyn -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">(==)</span></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Unique -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">(==)</span></span><span> </span><span class="annot"><span class="annottext">(Unique -&gt; Unique -&gt; Bool)
-&gt; (PatSyn -&gt; Unique) -&gt; PatSyn -&gt; PatSyn -&gt; Bool
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="../../base/src/Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span>
</span><span id="line-326"></span><span>    </span><span id="local-6989586621680848421"><span class="annot"><span class="annottext">/= :: PatSyn -&gt; PatSyn -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">(/=)</span></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Unique -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">(/=)</span></span><span> </span><span class="annot"><span class="annottext">(Unique -&gt; Unique -&gt; Bool)
-&gt; (PatSyn -&gt; Unique) -&gt; PatSyn -&gt; PatSyn -&gt; Bool
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="../../base/src/Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span>
</span><span id="line-327"></span><span>
</span><span id="line-328"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#Uniquable"><span class="hs-identifier hs-type">Uniquable</span></a></span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-329"></span><span>    </span><span id="local-6989586621680848417"><span class="annot"><span class="annottext">getUnique :: PatSyn -&gt; Unique
</span><a href="#local-6989586621680848417"><span class="hs-identifier hs-var hs-var hs-var hs-var">getUnique</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Unique
</span><a href="GHC.Core.PatSyn.html#psUnique"><span class="hs-identifier hs-var hs-var">psUnique</span></a></span><span>
</span><span id="line-330"></span><span>
</span><span id="line-331"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680848415"><span class="annot"><a href="GHC.Types.Name.html#NamedThing"><span class="hs-identifier hs-type">NamedThing</span></a></span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-332"></span><span>    </span><span id="local-6989586621680848412"><span class="annot"><span class="annottext">getName :: PatSyn -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var hs-var hs-var hs-var">getName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Name
</span><a href="GHC.Core.PatSyn.html#patSynName"><span class="hs-identifier hs-var">patSynName</span></a></span><span>
</span><span id="line-333"></span><span>
</span><span id="line-334"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680848408"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-335"></span><span>    </span><span id="local-6989586621680848404"><span class="annot"><span class="annottext">ppr :: PatSyn -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; SDoc) -&gt; (PatSyn -&gt; Name) -&gt; PatSyn -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span>
</span><span id="line-336"></span><span>
</span><span id="line-337"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680848394"><span id="local-6989586621680848398"><span class="annot"><a href="GHC.Utils.Outputable.html#OutputableBndr"><span class="hs-identifier hs-type">OutputableBndr</span></a></span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-338"></span><span>    </span><span id="local-6989586621680848388"><span class="annot"><span class="annottext">pprInfixOcc :: PatSyn -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprInfixOcc"><span class="hs-identifier hs-var hs-var hs-var hs-var">pprInfixOcc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. (Outputable a, NamedThing a) =&gt; a -&gt; SDoc
</span><a href="GHC.Types.Name.html#pprInfixName"><span class="hs-identifier hs-var">pprInfixName</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; SDoc) -&gt; (PatSyn -&gt; Name) -&gt; PatSyn -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span>
</span><span id="line-339"></span><span>    </span><span id="local-6989586621680848383"><span class="annot"><span class="annottext">pprPrefixOcc :: PatSyn -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprPrefixOcc"><span class="hs-identifier hs-var hs-var hs-var hs-var">pprPrefixOcc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. NamedThing a =&gt; a -&gt; SDoc
</span><a href="GHC.Types.Name.html#pprPrefixName"><span class="hs-identifier hs-var">pprPrefixName</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; SDoc) -&gt; (PatSyn -&gt; Name) -&gt; PatSyn -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span>
</span><span id="line-340"></span><span>
</span><span id="line-341"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680848354"><span id="local-6989586621680848356"><span id="local-6989586621680848358"><span id="local-6989586621680848360"><span id="local-6989586621680848362"><span id="local-6989586621680848364"><span id="local-6989586621680848366"><span id="local-6989586621680848368"><span id="local-6989586621680848370"><span id="local-6989586621680848372"><span id="local-6989586621680848377"><span class="annot"><a href="../../base/src/Data.Data.html#Data"><span class="hs-identifier hs-type">Data.Data</span></a></span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span></span></span></span></span></span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-342"></span><span>    </span><span class="hs-comment">-- don't traverse?</span><span>
</span><span id="line-343"></span><span>    </span><span id="local-6989586621680848352"><span class="annot"><span class="annottext">toConstr :: PatSyn -&gt; Constr
</span><a href="../../base/src/Data.Data.html#toConstr"><span class="hs-identifier hs-var hs-var hs-var hs-var">toConstr</span></a></span></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Constr
</span><a href="GHC.Utils.Misc.html#abstractConstr"><span class="hs-identifier hs-var">abstractConstr</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;PatSyn&quot;</span></span><span>
</span><span id="line-344"></span><span>    </span><span id="local-6989586621680848347"><span class="annot"><span class="annottext">gunfold :: forall (c :: * -&gt; *).
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c PatSyn
</span><a href="../../base/src/Data.Data.html#gunfold"><span class="hs-identifier hs-var hs-var hs-var hs-var">gunfold</span></a></span></span><span> </span><span class="annot"><span class="annottext">forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">forall r. r -&gt; c r
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Constr -&gt; c PatSyn
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;gunfold&quot;</span></span><span>
</span><span id="line-345"></span><span>    </span><span id="local-6989586621680848344"><span class="annot"><span class="annottext">dataTypeOf :: PatSyn -&gt; DataType
</span><a href="../../base/src/Data.Data.html#dataTypeOf"><span class="hs-identifier hs-var hs-var hs-var hs-var">dataTypeOf</span></a></span></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DataType
</span><a href="../../base/src/Data.Data.html#mkNoRepType"><span class="hs-identifier hs-var">mkNoRepType</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;PatSyn&quot;</span></span><span>
</span><span id="line-346"></span><span>
</span><span id="line-347"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Construction}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-354"></span><span>
</span><span id="line-355"></span><span class="hs-comment">-- | Build a new pattern synonym</span><span>
</span><span id="line-356"></span><span class="annot"><a href="GHC.Core.PatSyn.html#mkPatSyn"><span class="hs-identifier hs-type">mkPatSyn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-357"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>                 </span><span class="hs-comment">-- ^ Is the pattern synonym declared infix?</span><span>
</span><span id="line-358"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InvisTVBinder"><span class="hs-identifier hs-type">InvisTVBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier hs-type">ThetaType</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ Universially-quantified type</span><span>
</span><span id="line-359"></span><span>                                         </span><span class="hs-comment">-- variables and required dicts</span><span>
</span><span id="line-360"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InvisTVBinder"><span class="hs-identifier hs-type">InvisTVBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier hs-type">ThetaType</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ Existentially-quantified type</span><span>
</span><span id="line-361"></span><span>                                         </span><span class="hs-comment">-- variables and provided dicts</span><span>
</span><span id="line-362"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>               </span><span class="hs-comment">-- ^ Original arguments</span><span>
</span><span id="line-363"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>                 </span><span class="hs-comment">-- ^ Original result type</span><span>
</span><span id="line-364"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span>           </span><span class="hs-comment">-- ^ Name of matcher</span><span>
</span><span id="line-365"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span>     </span><span class="hs-comment">-- ^ Name of builder</span><span>
</span><span id="line-366"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span class="hs-special">]</span><span>         </span><span class="hs-comment">-- ^ Names of fields for</span><span>
</span><span id="line-367"></span><span>                                 </span><span class="hs-comment">--   a record pattern synonym</span><span>
</span><span id="line-368"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span>
</span><span id="line-369"></span><span> </span><span class="hs-comment">-- NB: The univ and ex vars are both in TyBinder form and TyVar form for</span><span>
</span><span id="line-370"></span><span> </span><span class="hs-comment">-- convenience. All the TyBinders should be Named!</span><span>
</span><span id="line-371"></span><span id="mkPatSyn"><span class="annot"><span class="annottext">mkPatSyn :: Name
-&gt; Bool
-&gt; ([InvisTVBinder], [Type])
-&gt; ([InvisTVBinder], [Type])
-&gt; [Type]
-&gt; Type
-&gt; (TyVar, Bool)
-&gt; Maybe (TyVar, Bool)
-&gt; [FieldLabel]
-&gt; PatSyn
</span><a href="GHC.Core.PatSyn.html#mkPatSyn"><span class="hs-identifier hs-var hs-var">mkPatSyn</span></a></span></span><span> </span><span id="local-6989586621680848341"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680848341"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621680848340"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680848340"><span class="hs-identifier hs-var">declared_infix</span></a></span></span><span>
</span><span id="line-372"></span><span>         </span><span class="hs-special">(</span><span id="local-6989586621680848339"><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848339"><span class="hs-identifier hs-var">univ_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680848338"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848338"><span class="hs-identifier hs-var">req_theta</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-373"></span><span>         </span><span class="hs-special">(</span><span id="local-6989586621680848337"><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848337"><span class="hs-identifier hs-var">ex_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680848336"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848336"><span class="hs-identifier hs-var">prov_theta</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-374"></span><span>         </span><span id="local-6989586621680848335"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848335"><span class="hs-identifier hs-var">orig_args</span></a></span></span><span>
</span><span id="line-375"></span><span>         </span><span id="local-6989586621680848334"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848334"><span class="hs-identifier hs-var">orig_res_ty</span></a></span></span><span>
</span><span id="line-376"></span><span>         </span><span id="local-6989586621680848333"><span class="annot"><span class="annottext">(TyVar, Bool)
</span><a href="#local-6989586621680848333"><span class="hs-identifier hs-var">matcher</span></a></span></span><span> </span><span id="local-6989586621680848332"><span class="annot"><span class="annottext">Maybe (TyVar, Bool)
</span><a href="#local-6989586621680848332"><span class="hs-identifier hs-var">builder</span></a></span></span><span> </span><span id="local-6989586621680848331"><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621680848331"><span class="hs-identifier hs-var">field_labels</span></a></span></span><span>
</span><span id="line-377"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MkPatSyn :: Name
-&gt; Unique
-&gt; [Type]
-&gt; Arity
-&gt; Bool
-&gt; [FieldLabel]
-&gt; [InvisTVBinder]
-&gt; [Type]
-&gt; [InvisTVBinder]
-&gt; [Type]
-&gt; Type
-&gt; (TyVar, Bool)
-&gt; Maybe (TyVar, Bool)
-&gt; PatSyn
</span><a href="GHC.Core.PatSyn.html#MkPatSyn"><span class="hs-identifier hs-type">MkPatSyn</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">psName :: Name
</span><a href="GHC.Core.PatSyn.html#psName"><span class="hs-identifier hs-var">psName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680848341"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psUnique :: Unique
</span><a href="GHC.Core.PatSyn.html#psUnique"><span class="hs-identifier hs-var">psUnique</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680848341"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-378"></span><span>                </span><span class="annot"><span class="annottext">psUnivTyVars :: [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psUnivTyVars"><span class="hs-identifier hs-var">psUnivTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848339"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-379"></span><span>                </span><span class="annot"><span class="annottext">psExTyVars :: [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psExTyVars"><span class="hs-identifier hs-var">psExTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848337"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-380"></span><span>                </span><span class="annot"><span class="annottext">psProvTheta :: [Type]
</span><a href="GHC.Core.PatSyn.html#psProvTheta"><span class="hs-identifier hs-var">psProvTheta</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848336"><span class="hs-identifier hs-var">prov_theta</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psReqTheta :: [Type]
</span><a href="GHC.Core.PatSyn.html#psReqTheta"><span class="hs-identifier hs-var">psReqTheta</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848338"><span class="hs-identifier hs-var">req_theta</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-381"></span><span>                </span><span class="annot"><span class="annottext">psInfix :: Bool
</span><a href="GHC.Core.PatSyn.html#psInfix"><span class="hs-identifier hs-var">psInfix</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680848340"><span class="hs-identifier hs-var">declared_infix</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-382"></span><span>                </span><span class="annot"><span class="annottext">psArgs :: [Type]
</span><a href="GHC.Core.PatSyn.html#psArgs"><span class="hs-identifier hs-var">psArgs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848335"><span class="hs-identifier hs-var">orig_args</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-383"></span><span>                </span><span class="annot"><span class="annottext">psArity :: Arity
</span><a href="GHC.Core.PatSyn.html#psArity"><span class="hs-identifier hs-var">psArity</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Arity
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Arity
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848335"><span class="hs-identifier hs-var">orig_args</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-384"></span><span>                </span><span class="annot"><span class="annottext">psResultTy :: Type
</span><a href="GHC.Core.PatSyn.html#psResultTy"><span class="hs-identifier hs-var">psResultTy</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848334"><span class="hs-identifier hs-var">orig_res_ty</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-385"></span><span>                </span><span class="annot"><span class="annottext">psMatcher :: (TyVar, Bool)
</span><a href="GHC.Core.PatSyn.html#psMatcher"><span class="hs-identifier hs-var">psMatcher</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyVar, Bool)
</span><a href="#local-6989586621680848333"><span class="hs-identifier hs-var">matcher</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-386"></span><span>                </span><span class="annot"><span class="annottext">psBuilder :: Maybe (TyVar, Bool)
</span><a href="GHC.Core.PatSyn.html#psBuilder"><span class="hs-identifier hs-var">psBuilder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (TyVar, Bool)
</span><a href="#local-6989586621680848332"><span class="hs-identifier hs-var">builder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-387"></span><span>                </span><span class="annot"><span class="annottext">psFieldLabels :: [FieldLabel]
</span><a href="GHC.Core.PatSyn.html#psFieldLabels"><span class="hs-identifier hs-var">psFieldLabels</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621680848331"><span class="hs-identifier hs-var">field_labels</span></a></span><span>
</span><span id="line-388"></span><span>                </span><span class="hs-special">}</span><span>
</span><span id="line-389"></span><span>
</span><span id="line-390"></span><span class="hs-comment">-- | The 'Name' of the 'PatSyn', giving it a unique, rooted identification</span><span>
</span><span id="line-391"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynName"><span class="hs-identifier hs-type">patSynName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-392"></span><span id="patSynName"><span class="annot"><span class="annottext">patSynName :: PatSyn -&gt; Name
</span><a href="GHC.Core.PatSyn.html#patSynName"><span class="hs-identifier hs-var hs-var">patSynName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Name
</span><a href="GHC.Core.PatSyn.html#psName"><span class="hs-identifier hs-var hs-var">psName</span></a></span><span>
</span><span id="line-393"></span><span>
</span><span id="line-394"></span><span class="hs-comment">-- | Should the 'PatSyn' be presented infix?</span><span>
</span><span id="line-395"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynIsInfix"><span class="hs-identifier hs-type">patSynIsInfix</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-396"></span><span id="patSynIsInfix"><span class="annot"><span class="annottext">patSynIsInfix :: PatSyn -&gt; Bool
</span><a href="GHC.Core.PatSyn.html#patSynIsInfix"><span class="hs-identifier hs-var hs-var">patSynIsInfix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Bool
</span><a href="GHC.Core.PatSyn.html#psInfix"><span class="hs-identifier hs-var hs-var">psInfix</span></a></span><span>
</span><span id="line-397"></span><span>
</span><span id="line-398"></span><span class="hs-comment">-- | Arity of the pattern synonym</span><span>
</span><span id="line-399"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynArity"><span class="hs-identifier hs-type">patSynArity</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span>
</span><span id="line-400"></span><span id="patSynArity"><span class="annot"><span class="annottext">patSynArity :: PatSyn -&gt; Arity
</span><a href="GHC.Core.PatSyn.html#patSynArity"><span class="hs-identifier hs-var hs-var">patSynArity</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Arity
</span><a href="GHC.Core.PatSyn.html#psArity"><span class="hs-identifier hs-var hs-var">psArity</span></a></span><span>
</span><span id="line-401"></span><span>
</span><span id="line-402"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynArgs"><span class="hs-identifier hs-type">patSynArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-403"></span><span id="patSynArgs"><span class="annot"><span class="annottext">patSynArgs :: PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#patSynArgs"><span class="hs-identifier hs-var hs-var">patSynArgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#psArgs"><span class="hs-identifier hs-var hs-var">psArgs</span></a></span><span>
</span><span id="line-404"></span><span>
</span><span id="line-405"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynFieldLabels"><span class="hs-identifier hs-type">patSynFieldLabels</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-406"></span><span id="patSynFieldLabels"><span class="annot"><span class="annottext">patSynFieldLabels :: PatSyn -&gt; [FieldLabel]
</span><a href="GHC.Core.PatSyn.html#patSynFieldLabels"><span class="hs-identifier hs-var hs-var">patSynFieldLabels</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; [FieldLabel]
</span><a href="GHC.Core.PatSyn.html#psFieldLabels"><span class="hs-identifier hs-var hs-var">psFieldLabels</span></a></span><span>
</span><span id="line-407"></span><span>
</span><span id="line-408"></span><span class="hs-comment">-- | Extract the type for any given labelled field of the 'DataCon'</span><span>
</span><span id="line-409"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynFieldType"><span class="hs-identifier hs-type">patSynFieldType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabelString"><span class="hs-identifier hs-type">FieldLabelString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-410"></span><span id="patSynFieldType"><span class="annot"><span class="annottext">patSynFieldType :: PatSyn -&gt; FieldLabelString -&gt; Type
</span><a href="GHC.Core.PatSyn.html#patSynFieldType"><span class="hs-identifier hs-var hs-var">patSynFieldType</span></a></span></span><span> </span><span id="local-6989586621680848329"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680848329"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span id="local-6989586621680848328"><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621680848328"><span class="hs-keyword hs-var">label</span></a></span></span><span>
</span><span id="line-411"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">((FieldLabel, Type) -&gt; Bool)
-&gt; [(FieldLabel, Type)] -&gt; Maybe (FieldLabel, Type)
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Maybe a
</span><a href="../../base/src/Data.Foldable.html#find"><span class="hs-identifier hs-var">find</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">FieldLabelString -&gt; FieldLabelString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621680848328"><span class="hs-keyword hs-var">label</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(FieldLabelString -&gt; Bool)
-&gt; ((FieldLabel, Type) -&gt; FieldLabelString)
-&gt; (FieldLabel, Type)
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FieldLabel -&gt; FieldLabelString
forall a. FieldLbl a -&gt; FieldLabelString
</span><a href="GHC.Types.FieldLabel.html#flLabel"><span class="hs-identifier hs-var hs-var">flLabel</span></a></span><span> </span><span class="annot"><span class="annottext">(FieldLabel -&gt; FieldLabelString)
-&gt; ((FieldLabel, Type) -&gt; FieldLabel)
-&gt; (FieldLabel, Type)
-&gt; FieldLabelString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(FieldLabel, Type) -&gt; FieldLabel
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PatSyn -&gt; [FieldLabel]
</span><a href="GHC.Core.PatSyn.html#psFieldLabels"><span class="hs-identifier hs-var hs-var">psFieldLabels</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680848329"><span class="hs-identifier hs-var">ps</span></a></span><span> </span><span class="annot"><span class="annottext">[FieldLabel] -&gt; [Type] -&gt; [(FieldLabel, Type)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#psArgs"><span class="hs-identifier hs-var hs-var">psArgs</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680848329"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-412"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FieldLabel
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680848326"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848326"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848326"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-413"></span><span>      </span><span class="annot"><span class="annottext">Maybe (FieldLabel, Type)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Type
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dataConFieldType&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PatSyn -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680848329"><span class="hs-identifier hs-var">ps</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FieldLabelString -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">FieldLabelString
</span><a href="#local-6989586621680848328"><span class="hs-keyword hs-var">label</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-414"></span><span>
</span><span id="line-415"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynUnivTyVarBinders"><span class="hs-identifier hs-type">patSynUnivTyVarBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InvisTVBinder"><span class="hs-identifier hs-type">InvisTVBinder</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-416"></span><span id="patSynUnivTyVarBinders"><span class="annot"><span class="annottext">patSynUnivTyVarBinders :: PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#patSynUnivTyVarBinders"><span class="hs-identifier hs-var hs-var">patSynUnivTyVarBinders</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psUnivTyVars"><span class="hs-identifier hs-var hs-var">psUnivTyVars</span></a></span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynExTyVars"><span class="hs-identifier hs-type">patSynExTyVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-419"></span><span id="patSynExTyVars"><span class="annot"><span class="annottext">patSynExTyVars :: PatSyn -&gt; [TyVar]
</span><a href="GHC.Core.PatSyn.html#patSynExTyVars"><span class="hs-identifier hs-var hs-var">patSynExTyVars</span></a></span></span><span> </span><span id="local-6989586621680848323"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680848323"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder] -&gt; [TyVar]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psExTyVars"><span class="hs-identifier hs-var hs-var">psExTyVars</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680848323"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-420"></span><span>
</span><span id="line-421"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynExTyVarBinders"><span class="hs-identifier hs-type">patSynExTyVarBinders</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InvisTVBinder"><span class="hs-identifier hs-type">InvisTVBinder</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-422"></span><span id="patSynExTyVarBinders"><span class="annot"><span class="annottext">patSynExTyVarBinders :: PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#patSynExTyVarBinders"><span class="hs-identifier hs-var hs-var">patSynExTyVarBinders</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psExTyVars"><span class="hs-identifier hs-var hs-var">psExTyVars</span></a></span><span>
</span><span id="line-423"></span><span>
</span><span id="line-424"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynSigBndr"><span class="hs-identifier hs-type">patSynSigBndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InvisTVBinder"><span class="hs-identifier hs-type">InvisTVBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier hs-type">ThetaType</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InvisTVBinder"><span class="hs-identifier hs-type">InvisTVBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier hs-type">ThetaType</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-425"></span><span id="patSynSigBndr"><span class="annot"><span class="annottext">patSynSigBndr :: PatSyn
-&gt; ([InvisTVBinder], [Type], [InvisTVBinder], [Type],
    [Scaled Type], Type)
</span><a href="GHC.Core.PatSyn.html#patSynSigBndr"><span class="hs-identifier hs-var hs-var">patSynSigBndr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.PatSyn.html#MkPatSyn"><span class="hs-identifier hs-type">MkPatSyn</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psUnivTyVars :: PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psUnivTyVars"><span class="hs-identifier hs-var">psUnivTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848321"><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848321"><span class="hs-identifier hs-var">univ_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psExTyVars :: PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psExTyVars"><span class="hs-identifier hs-var">psExTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848320"><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848320"><span class="hs-identifier hs-var">ex_tvs</span></a></span></span><span>
</span><span id="line-426"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psProvTheta :: PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#psProvTheta"><span class="hs-identifier hs-var">psProvTheta</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848319"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848319"><span class="hs-identifier hs-var">prov</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psReqTheta :: PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#psReqTheta"><span class="hs-identifier hs-var">psReqTheta</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848318"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848318"><span class="hs-identifier hs-var">req</span></a></span></span><span>
</span><span id="line-427"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psArgs :: PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#psArgs"><span class="hs-identifier hs-var">psArgs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848317"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848317"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psResultTy :: PatSyn -&gt; Type
</span><a href="GHC.Core.PatSyn.html#psResultTy"><span class="hs-identifier hs-var">psResultTy</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848316"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848316"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-428"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848321"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848318"><span class="hs-identifier hs-var">req</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848320"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848319"><span class="hs-identifier hs-var">prov</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Scaled Type) -&gt; [Type] -&gt; [Scaled Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Scaled Type
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848317"><span class="hs-identifier hs-var">arg_tys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848316"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-429"></span><span>
</span><span id="line-430"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynSig"><span class="hs-identifier hs-type">patSynSig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier hs-type">ThetaType</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier hs-type">ThetaType</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-431"></span><span id="patSynSig"><span class="annot"><span class="annottext">patSynSig :: PatSyn -&gt; ([TyVar], [Type], [TyVar], [Type], [Scaled Type], Type)
</span><a href="GHC.Core.PatSyn.html#patSynSig"><span class="hs-identifier hs-var hs-var">patSynSig</span></a></span></span><span> </span><span id="local-6989586621680848314"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680848314"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680848313"><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848313"><span class="hs-identifier hs-var">u_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680848312"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848312"><span class="hs-identifier hs-var">req</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680848311"><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848311"><span class="hs-identifier hs-var">e_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680848310"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848310"><span class="hs-identifier hs-var">prov</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680848309"><span class="annot"><span class="annottext">[Scaled Type]
</span><a href="#local-6989586621680848309"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680848308"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848308"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn
-&gt; ([InvisTVBinder], [Type], [InvisTVBinder], [Type],
    [Scaled Type], Type)
</span><a href="GHC.Core.PatSyn.html#patSynSigBndr"><span class="hs-identifier hs-var">patSynSigBndr</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680848314"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-432"></span><span>               </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[InvisTVBinder] -&gt; [TyVar]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848313"><span class="hs-identifier hs-var">u_tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848312"><span class="hs-identifier hs-var">req</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder] -&gt; [TyVar]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848311"><span class="hs-identifier hs-var">e_tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848310"><span class="hs-identifier hs-var">prov</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Scaled Type]
</span><a href="#local-6989586621680848309"><span class="hs-identifier hs-var">arg_tys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848308"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynMatcher"><span class="hs-identifier hs-type">patSynMatcher</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span>
</span><span id="line-435"></span><span id="patSynMatcher"><span class="annot"><span class="annottext">patSynMatcher :: PatSyn -&gt; (TyVar, Bool)
</span><a href="GHC.Core.PatSyn.html#patSynMatcher"><span class="hs-identifier hs-var hs-var">patSynMatcher</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; (TyVar, Bool)
</span><a href="GHC.Core.PatSyn.html#psMatcher"><span class="hs-identifier hs-var hs-var">psMatcher</span></a></span><span>
</span><span id="line-436"></span><span>
</span><span id="line-437"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynBuilder"><span class="hs-identifier hs-type">patSynBuilder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span>
</span><span id="line-438"></span><span id="patSynBuilder"><span class="annot"><span class="annottext">patSynBuilder :: PatSyn -&gt; Maybe (TyVar, Bool)
</span><a href="GHC.Core.PatSyn.html#patSynBuilder"><span class="hs-identifier hs-var hs-var">patSynBuilder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Maybe (TyVar, Bool)
</span><a href="GHC.Core.PatSyn.html#psBuilder"><span class="hs-identifier hs-var hs-var">psBuilder</span></a></span><span>
</span><span id="line-439"></span><span>
</span><span id="line-440"></span><span class="annot"><a href="GHC.Core.PatSyn.html#updatePatSynIds"><span class="hs-identifier hs-type">updatePatSynIds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span>
</span><span id="line-441"></span><span id="updatePatSynIds"><span class="annot"><span class="annottext">updatePatSynIds :: (TyVar -&gt; TyVar) -&gt; PatSyn -&gt; PatSyn
</span><a href="GHC.Core.PatSyn.html#updatePatSynIds"><span class="hs-identifier hs-var hs-var">updatePatSynIds</span></a></span></span><span> </span><span id="local-6989586621680848307"><span class="annot"><span class="annottext">TyVar -&gt; TyVar
</span><a href="#local-6989586621680848307"><span class="hs-identifier hs-var">tidy_fn</span></a></span></span><span> </span><span id="local-6989586621680848306"><span class="annot"><span class="annottext">ps :: PatSyn
</span><a href="#local-6989586621680848306"><span class="hs-identifier hs-var">ps</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.PatSyn.html#MkPatSyn"><span class="hs-identifier hs-type">MkPatSyn</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psMatcher :: PatSyn -&gt; (TyVar, Bool)
</span><a href="GHC.Core.PatSyn.html#psMatcher"><span class="hs-identifier hs-var">psMatcher</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848305"><span class="annot"><span class="annottext">(TyVar, Bool)
</span><a href="#local-6989586621680848305"><span class="hs-identifier hs-var">matcher</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psBuilder :: PatSyn -&gt; Maybe (TyVar, Bool)
</span><a href="GHC.Core.PatSyn.html#psBuilder"><span class="hs-identifier hs-var">psBuilder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848304"><span class="annot"><span class="annottext">Maybe (TyVar, Bool)
</span><a href="#local-6989586621680848304"><span class="hs-identifier hs-var">builder</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-442"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680848306"><span class="hs-identifier hs-var">ps</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psMatcher :: (TyVar, Bool)
</span><a href="GHC.Core.PatSyn.html#psMatcher"><span class="hs-identifier hs-var">psMatcher</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyVar, Bool) -&gt; (TyVar, Bool)
forall {b}. (TyVar, b) -&gt; (TyVar, b)
</span><a href="#local-6989586621680848303"><span class="hs-identifier hs-var">tidy_pr</span></a></span><span> </span><span class="annot"><span class="annottext">(TyVar, Bool)
</span><a href="#local-6989586621680848305"><span class="hs-identifier hs-var">matcher</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psBuilder :: Maybe (TyVar, Bool)
</span><a href="GHC.Core.PatSyn.html#psBuilder"><span class="hs-identifier hs-var">psBuilder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((TyVar, Bool) -&gt; (TyVar, Bool))
-&gt; Maybe (TyVar, Bool) -&gt; Maybe (TyVar, Bool)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">(TyVar, Bool) -&gt; (TyVar, Bool)
forall {b}. (TyVar, b) -&gt; (TyVar, b)
</span><a href="#local-6989586621680848303"><span class="hs-identifier hs-var">tidy_pr</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (TyVar, Bool)
</span><a href="#local-6989586621680848304"><span class="hs-identifier hs-var">builder</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-443"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-444"></span><span>    </span><span id="local-6989586621680848303"><span class="annot"><span class="annottext">tidy_pr :: (TyVar, b) -&gt; (TyVar, b)
</span><a href="#local-6989586621680848303"><span class="hs-identifier hs-var hs-var">tidy_pr</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680848302"><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680848302"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680848301"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621680848301"><span class="hs-identifier hs-var">dummy</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyVar -&gt; TyVar
</span><a href="#local-6989586621680848307"><span class="hs-identifier hs-var">tidy_fn</span></a></span><span> </span><span class="annot"><span class="annottext">TyVar
</span><a href="#local-6989586621680848302"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621680848301"><span class="hs-identifier hs-var">dummy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-445"></span><span>
</span><span id="line-446"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynInstArgTys"><span class="hs-identifier hs-type">patSynInstArgTys</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-447"></span><span class="hs-comment">-- Return the types of the argument patterns</span><span>
</span><span id="line-448"></span><span class="hs-comment">-- e.g.  data D a = forall b. MkD a b (b-&gt;a)</span><span>
</span><span id="line-449"></span><span class="hs-comment">--       pattern P f x y = MkD (x,True) y f</span><span>
</span><span id="line-450"></span><span class="hs-comment">--          D :: forall a. forall b. a -&gt; b -&gt; (b-&gt;a) -&gt; D a</span><span>
</span><span id="line-451"></span><span class="hs-comment">--          P :: forall c. forall b. (b-&gt;(c,Bool)) -&gt; c -&gt; b -&gt; P c</span><span>
</span><span id="line-452"></span><span class="hs-comment">--   patSynInstArgTys P [Int,bb] = [bb-&gt;(Int,Bool), Int, bb]</span><span>
</span><span id="line-453"></span><span class="hs-comment">-- NB: the inst_tys should be both universal and existential</span><span>
</span><span id="line-454"></span><span id="patSynInstArgTys"><span class="annot"><span class="annottext">patSynInstArgTys :: PatSyn -&gt; [Type] -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#patSynInstArgTys"><span class="hs-identifier hs-var hs-var">patSynInstArgTys</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.PatSyn.html#MkPatSyn"><span class="hs-identifier hs-type">MkPatSyn</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psName :: PatSyn -&gt; Name
</span><a href="GHC.Core.PatSyn.html#psName"><span class="hs-identifier hs-var">psName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848300"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680848300"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psUnivTyVars :: PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psUnivTyVars"><span class="hs-identifier hs-var">psUnivTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848299"><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848299"><span class="hs-identifier hs-var">univ_tvs</span></a></span></span><span>
</span><span id="line-455"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psExTyVars :: PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psExTyVars"><span class="hs-identifier hs-var">psExTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848298"><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848298"><span class="hs-identifier hs-var">ex_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psArgs :: PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#psArgs"><span class="hs-identifier hs-var">psArgs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848297"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848297"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-456"></span><span>                 </span><span id="local-6989586621680848296"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848296"><span class="hs-identifier hs-var">inst_tys</span></a></span></span><span>
</span><span id="line-457"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">tyvars</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">equalLength</span><span class="hs-special">`</span><span> </span><span class="hs-identifier">inst_tys</span><span>
</span><span id="line-458"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">text</span><span> </span><span class="hs-string">&quot;patSynInstArgTys&quot;</span><span> </span><span class="hs-operator">&lt;+&gt;</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-operator">$$</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">tyvars</span><span> </span><span class="hs-operator">$$</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">inst_tys</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-459"></span><span>    </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; [Type] -&gt; [Type]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasCallStack =&gt; [TyVar] -&gt; [Type] -&gt; Type -&gt; Type
[TyVar] -&gt; [Type] -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Subst.html#substTyWith"><span class="hs-identifier hs-var">substTyWith</span></a></span><span> </span><span class="annot"><span class="annottext">[TyVar]
</span><a href="#local-6989586621680848292"><span class="hs-identifier hs-var">tyvars</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848296"><span class="hs-identifier hs-var">inst_tys</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848297"><span class="hs-identifier hs-var">arg_tys</span></a></span><span>
</span><span id="line-460"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-461"></span><span>    </span><span id="local-6989586621680848292"><span class="annot"><span class="annottext">tyvars :: [TyVar]
</span><a href="#local-6989586621680848292"><span class="hs-identifier hs-var hs-var">tyvars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder] -&gt; [TyVar]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848299"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder] -&gt; [InvisTVBinder] -&gt; [InvisTVBinder]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848298"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-462"></span><span>
</span><span id="line-463"></span><span class="annot"><a href="GHC.Core.PatSyn.html#patSynInstResTy"><span class="hs-identifier hs-type">patSynInstResTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-464"></span><span class="hs-comment">-- Return the type of whole pattern</span><span>
</span><span id="line-465"></span><span class="hs-comment">-- E.g.  pattern P x y = Just (x,x,y)</span><span>
</span><span id="line-466"></span><span class="hs-comment">--         P :: a -&gt; b -&gt; Just (a,a,b)</span><span>
</span><span id="line-467"></span><span class="hs-comment">--         (patSynInstResTy P [Int,Bool] = Maybe (Int,Int,Bool)</span><span>
</span><span id="line-468"></span><span class="hs-comment">-- NB: unlike patSynInstArgTys, the inst_tys should be just the *universal* tyvars</span><span>
</span><span id="line-469"></span><span id="patSynInstResTy"><span class="annot"><span class="annottext">patSynInstResTy :: PatSyn -&gt; [Type] -&gt; Type
</span><a href="GHC.Core.PatSyn.html#patSynInstResTy"><span class="hs-identifier hs-var hs-var">patSynInstResTy</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.PatSyn.html#MkPatSyn"><span class="hs-identifier hs-type">MkPatSyn</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psName :: PatSyn -&gt; Name
</span><a href="GHC.Core.PatSyn.html#psName"><span class="hs-identifier hs-var">psName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848286"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621680848286"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psUnivTyVars :: PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psUnivTyVars"><span class="hs-identifier hs-var">psUnivTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848285"><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848285"><span class="hs-identifier hs-var">univ_tvs</span></a></span></span><span>
</span><span id="line-470"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psResultTy :: PatSyn -&gt; Type
</span><a href="GHC.Core.PatSyn.html#psResultTy"><span class="hs-identifier hs-var">psResultTy</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848284"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848284"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-471"></span><span>                </span><span id="local-6989586621680848283"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848283"><span class="hs-identifier hs-var">inst_tys</span></a></span></span><span>
</span><span id="line-472"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">univ_tvs</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">equalLength</span><span class="hs-special">`</span><span> </span><span class="hs-identifier">inst_tys</span><span>
</span><span id="line-473"></span><span>           </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">text</span><span> </span><span class="hs-string">&quot;patSynInstResTy&quot;</span><span> </span><span class="hs-operator">&lt;+&gt;</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-operator">$$</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">univ_tvs</span><span> </span><span class="hs-operator">$$</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">inst_tys</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-474"></span><span>    </span><span class="annot"><span class="annottext">HasCallStack =&gt; [TyVar] -&gt; [Type] -&gt; Type -&gt; Type
[TyVar] -&gt; [Type] -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Subst.html#substTyWith"><span class="hs-identifier hs-var">substTyWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[InvisTVBinder] -&gt; [TyVar]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848285"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848283"><span class="hs-identifier hs-var">inst_tys</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848284"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-475"></span><span>
</span><span id="line-476"></span><span class="hs-comment">-- | Print the type of a pattern synonym. The foralls are printed explicitly</span><span>
</span><span id="line-477"></span><span class="annot"><a href="GHC.Core.PatSyn.html#pprPatSynType"><span class="hs-identifier hs-type">pprPatSynType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-478"></span><span id="pprPatSynType"><span class="annot"><span class="annottext">pprPatSynType :: PatSyn -&gt; SDoc
</span><a href="GHC.Core.PatSyn.html#pprPatSynType"><span class="hs-identifier hs-var hs-var">pprPatSynType</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.PatSyn.html#MkPatSyn"><span class="hs-identifier hs-type">MkPatSyn</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psUnivTyVars :: PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psUnivTyVars"><span class="hs-identifier hs-var">psUnivTyVars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848282"><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848282"><span class="hs-identifier hs-var">univ_tvs</span></a></span></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">psReqTheta :: PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#psReqTheta"><span class="hs-identifier hs-var">psReqTheta</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848281"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848281"><span class="hs-identifier hs-var">req_theta</span></a></span></span><span>
</span><span id="line-479"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psExTyVars :: PatSyn -&gt; [InvisTVBinder]
</span><a href="GHC.Core.PatSyn.html#psExTyVars"><span class="hs-identifier hs-var">psExTyVars</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848280"><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848280"><span class="hs-identifier hs-var">ex_tvs</span></a></span></span><span class="hs-special">,</span><span>    </span><span class="annot"><span class="annottext">psProvTheta :: PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#psProvTheta"><span class="hs-identifier hs-var">psProvTheta</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848279"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848279"><span class="hs-identifier hs-var">prov_theta</span></a></span></span><span>
</span><span id="line-480"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psArgs :: PatSyn -&gt; [Type]
</span><a href="GHC.Core.PatSyn.html#psArgs"><span class="hs-identifier hs-var">psArgs</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848278"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848278"><span class="hs-identifier hs-var">orig_args</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psResultTy :: PatSyn -&gt; Type
</span><a href="GHC.Core.PatSyn.html#psResultTy"><span class="hs-identifier hs-var">psResultTy</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680848277"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848277"><span class="hs-identifier hs-var">orig_res_ty</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-481"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[TyCoVarBinder] -&gt; SDoc
</span><a href="GHC.Core.TyCo.Ppr.html#pprForAll"><span class="hs-identifier hs-var">pprForAll</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVarBinder] -&gt; SDoc) -&gt; [TyCoVarBinder] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder] -&gt; [TyCoVarBinder]
forall a. [VarBndr a Specificity] -&gt; [VarBndr a ArgFlag]
</span><a href="GHC.Types.Var.html#tyVarSpecToBinders"><span class="hs-identifier hs-var">tyVarSpecToBinders</span></a></span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848282"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span>
</span><span id="line-482"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; SDoc
</span><a href="GHC.Core.TyCo.Ppr.html#pprThetaArrowTy"><span class="hs-identifier hs-var">pprThetaArrowTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848281"><span class="hs-identifier hs-var">req_theta</span></a></span><span>
</span><span id="line-483"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppWhen"><span class="hs-identifier hs-var">ppWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680848271"><span class="hs-identifier hs-var">insert_empty_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#darrow"><span class="hs-identifier hs-var">darrow</span></a></span><span>
</span><span id="line-484"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; SDoc
</span><a href="GHC.Core.TyCo.Ppr.html#pprType"><span class="hs-identifier hs-var">pprType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848266"><span class="hs-identifier hs-var">sigma_ty</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-485"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-486"></span><span>    </span><span id="local-6989586621680848266"><span class="annot"><span class="annottext">sigma_ty :: Type
</span><a href="#local-6989586621680848266"><span class="hs-identifier hs-var hs-var">sigma_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder] -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkInvisForAllTys"><span class="hs-identifier hs-var">mkInvisForAllTys</span></a></span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848280"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; Type -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-487"></span><span>               </span><span class="annot"><span class="annottext">[Type] -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkInvisFunTysMany"><span class="hs-identifier hs-var">mkInvisFunTysMany</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848279"><span class="hs-identifier hs-var">prov_theta</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Type) -&gt; Type -&gt; Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-488"></span><span>               </span><span class="annot"><span class="annottext">[Type] -&gt; Type -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTysMany"><span class="hs-identifier hs-var">mkVisFunTysMany</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848278"><span class="hs-identifier hs-var">orig_args</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848277"><span class="hs-identifier hs-var">orig_res_ty</span></a></span><span>
</span><span id="line-489"></span><span>    </span><span id="local-6989586621680848271"><span class="annot"><span class="annottext">insert_empty_ctxt :: Bool
</span><a href="#local-6989586621680848271"><span class="hs-identifier hs-var hs-var">insert_empty_ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848281"><span class="hs-identifier hs-var">req_theta</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848279"><span class="hs-identifier hs-var">prov_theta</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[InvisTVBinder]
</span><a href="#local-6989586621680848280"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-490"></span></pre></body></html>